home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
fish
/
726-750
/
729
/
bbbbs
/
spellbbs.lzh
/
Spell
/
spellchk.rexx
< prev
Wrap
OS/2 REXX Batch file
|
1991-04-08
|
1KB
|
56 lines
/* RxSpell.rexx - revised 21 Mar 1991 by RLStockton for BaudBandit
RxSpell docs:
As words are sent to RxSpell it will load the dict file as needed, eating
up lots of memory :-)
There are only 2 commands: Quit, and CheckWord (or just Check)
Quit tells RxSpell to quit.
CkeckWord, given a word as an argument, searches for the word and returns 1
if the word was found, 0 if it wasn't, and 10 if there was an error reading
the file or there wasn't enough memory.
*/
SIGNAL ON BREAK_C
SIGNAL ON BREAK_E
rev = ""
pen3 = "
"
def = ""
CR = "0D"x
LF = "0A"x
bbspath=GETCLIP('BBS_path')
RxStart='CD' bbspath'Spell'LF'Run RxSpell Dict.'
PARSE ARG name
IF ~Open(fh,name,r) then do;Say 'Can''t open file'CR;exit;end
IF ~Show(P,SPELL) then address command RxStart
do i=1 TO 50 while ~Show(P,SPELL);call Delay 10;end
IF ~Show(P,SPELL) then do;Say 'RxSpell problems, exiting'CR;exit;end
ADDRESS SPELL
DO linenumber=1 WHILE ~EOF(fh)
new=''
line=ReadLn(fh)
line=Translate(line,' ','9'x'_.-/') /* ARexx doesn't like mixed tabs and spaces */
DO i=1 TO Words(line)
wd=Word(line,i)
Check wd
IF RC=0 THEN new=new rev||wd||def
ELSE IF RC=1 THEN new=new wd
ELSE IF RC=10 THEN Say 'File Error!'CR
ELSE Say 'Unknown Error 'RC'. word='i' line='line||CR
END
SAY pen3||RIGHT(linenumber,3)||def new||CR
END
BREAK_E:
BREAK_C:
EXIT;